﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Proggy.Data.Entities;

namespace Proggy.Data.Abstract
{
    /// <summary>
    /// Data repository
    /// </summary>
    public interface IRandomDataRepository
    {
        /// <summary>
        /// The items
        /// </summary>
        IQueryable<RandomDataItem> RandomDataItems { get; }

        /// <summary>
        /// Create new
        /// </summary>
        /// <param name="id"></param>
        /// <param name="category"></param>
        /// <param name="value"></param>
        /// <param name="errorMsg"></param>
        /// <returns></returns>
        bool GetCreateOk(string id, string category, string value, string currentUsername, ref string errorMsg);

        /// <summary>
        /// Edit existing
        /// </summary>
        /// <param name="id"></param>
        /// <param name="category"></param>
        /// <param name="value"></param>
        /// <param name="errorMsg"></param>
        /// <returns></returns>
        bool GetEditOk(string id, string category, string value, string currentUsername, ref string errorMsg);

        /// <summary>
        /// Delete data
        /// </summary>
        /// <param name="dataId"></param>
        void Delete(string dataId);

        /// <summary>
        /// Get data by cat name, ordered by value
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        IQueryable<RandomDataItem> GetDataByCategoryName(string category);
    }
}
